package com.applet.applet_shangcheng.dao;

import com.applet.applet_shangcheng.entity.Announcement;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AnnouncementMapper {

    @Select({
            "select id ,content,create_date ,status from tb_announcement where status =1"
    })
    List<Announcement> findAllS();
    @Select({
            "select id ,content,create_date ,status from tb_announcement where id =#{id}"
    })
   Announcement findAnnouncement(int id);

    //Mapper
    int insertAnnouncement(Announcement announcement);
    //Mapper
    int updateStatus(@Param("id") int id,@Param("status") int status);
    @Delete({
            "delete from tb_announcement where id=#{id}"
    })
    int deleteAnnouncement(@Param("id") int id);
    //Mapper
    int updateAnnouncement(Announcement announcement);

   // Page<Announcement> findAll( String queryString);
    List<Announcement> findAll(String queryString);
}

